Batch 1 of the objectui#7307 burn-down: the `/api/v1/security/explain`
family outside app-shell and plugin-detail, plus the one plugin-charts
`/api/v1/meta/object/task` row. Five files stop opening a real socket,
and their lines leave `KNOWN_ESCAPES` and `PINNED_LEDGER` together.
Each escape was traced to its call site with a stack probe on the guard's
attribution point rather than inferred:
catalog-gallery-render / ObjectView.namedViewSortArity /
bulkDeleteVisibleWhen -> ObjectGrid -> useRecordCrudVerdicts:199
ObjectCalendar.navWidthDefault -> RecordDetailDrawer -> useRecordEditable:75
ObjectChart.heightChain -> ObjectChart.tsx:390 -> loadObjectSchema
All five take the same `apiFetch ?? fetch` fallback, so the double is one
shape per endpoint in the shape objectui#5225 landed (`vi.stubGlobal` +
`cleanup()` before `vi.unstubAllGlobals()`, objectui#7439's ordering): a
RECORDING router, not a blanket stub — `afterEach` fails on any URL that
is not the route it serves, so a new escape reds instead of vanishing
into the hook's best-effort `catch`.
The explain double answers the permissive verdict in the two response
shapes the two hooks read. That changes no assertion: `useRecordEditable`
initialises `allowed` to `true` and its failure path leaves it there, and
the only consumer of the batched lookup is
`resolveRowRecordCrudAffordance`, whose rule is `recordVerdict !== false`
— so `true` and the absent verdict the failing request produced are the
same value at every read site.
Ledger: 21 -> 16 in both lists, in lockstep.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MM7kaS4dPpYHV5BsMyu4tQ
Part of #7307 — batch 1 of the burn-down. The card stays open until both ledgers are empty; 16 rows remain.
Five files stop opening a real socket, and their lines leave
KNOWN_ESCAPES(invitest.setup.network-escape-guard.ts) andPINNED_LEDGER(inscripts/__tests__/network-escape-ledger.test.ts) in the same commit, as the guard's own header requires.Ledger arithmetic: 21 → 16 in BOTH lists. Verified in lockstep, not by counting twice:
diffof the quoted paths in the two literals is empty, and the pin's two reconciles (grew / went stale) plus its non-vacuity floor are green.Per file — endpoint, mechanism, double
Every mechanism below was traced, not inferred: a stack probe injected at the guard's attribution point, run once per file, then reverted (mutation and restore both proven on disk; the guard's blob is byte-identical to HEAD).
examples/schema-catalog/test/catalog-gallery-render.test.tsx/api/v1/security/explain(18 per run)ObjectGrid.tsx:1407→useRecordCrudVerdicts.ts:199apiFetch ?? fetchpackages/plugin-view/src/__tests__/ObjectView.namedViewSortArity.test.tsx/api/v1/security/explain(8)ObjectView→ObjectGrid→useRecordCrudVerdicts.ts:199packages/plugin-grid/src/__tests__/bulkDeleteVisibleWhen.test.tsx/api/v1/security/explain(4)ObjectGrid→useRecordCrudVerdicts.ts:199packages/plugin-calendar/src/ObjectCalendar.navWidthDefault.test.tsx/api/v1/security/explain(6)RecordDetailDrawer→useRecordEditable.ts:75apiFetch ?? fetchpackages/plugin-charts/src/ObjectChart.heightChain.test.tsx/api/v1/meta/object/task(1)ObjectChart.tsx:390→loadObjectSchema(:411) →loadDimensionFieldMetaAll five take an
apiFetch ?? fetchfallback with no hostapiFetchin the tree, exactly as #7307 measured. Zone 2 A2 holds, with one refinement worth recording: the dispatch expected the explain rows to share ONE hook. They do not — three of the four go through plugin-grid'suseRecordCrudVerdicts, the calendar one through plugin-detail'suseRecordEditable. One router shape still serves them, because both hooks POST the same route; the two differ only in the response they read, and the double answers both (see below).The double, and why it changes no assertion
The landed #5225 shape (
vi.stubGlobal('fetch', router), andcleanup()beforevi.unstubAllGlobals()— #7439's ordering, so the tree is unmounted while the double is still installed). Not a blanket network stub: it is a recording router, andafterEachfails on any URL that is not the route it serves, so a new escape reds here instead of vanishing into the hook's best-effortcatch. That assertion is also what stops the double degrading into a silencer: a route regex that stopped matching would 404 into the same fail-open path and look green, and this fails instead.The explain router answers the permissive verdict in the two shapes the two hooks read (ADR-0090 D6 / ADR-0095 C2), keyed off the request body:
{ record: { visible: true } }for a singlerecordId,{ records: [{ recordId, visible: true }] }for a batchedrecordIds. That is the same downstream state the failing request produced, at every read site:useRecordEditableinitialisesallowedtotrueand its failure path leaves it there;resolveRowRecordCrudAffordance(rowCrudAffordances.ts:224), whose rule is!!objectVerdict && recordVerdict !== false— sotrueand theundefinedthe failing request produced are the same value there.The charts router serves a field-less document, so
loadDimensionFieldMetaresolves no option colours andoptionMetasettles null — the state the failing request already produced;ChartRendereris mocked to null in that file anyway.Zone 2 A3 — the ablation (the guard IS the acceptance criterion)
On the committed tree, one script with
trap ... EXIT INT TERMand absolute paths: one converted file's double reverted to the base blob while its line stays deleted from both ledgers.packages/plugin-calendar/src/ObjectCalendar.navWidthDefault.test.tsxblob6146d87e(HEAD) →f03ca1ff(equal to the36fc746base blob, checked); anchorsinstallExplainDouble2 → 0,vi.stubGlobal1 → 0; ledger state during the run confirmed: that path appears 0 times inKNOWN_ESCAPESand 0 times inPINNED_LEDGER;Tests 3 failed (3), every one of themNetwork escape: this test reached a REAL socket at http://localhost:3000/api/v1/security/explain,file: packages/plugin-calendar/src/ObjectCalendar.navWidthDefault.test.tsx;git checkout HEAD -- path→ blob back to6146d87e,git diff HEADon that path EMPTY,git status --porcelainempty.No
dist/preflight leg: these are the vitest projects' own test files, read from disk by the runner, and the root config aliases every package specifier tosrc— measured, in that all five suites ran green on a completely unbuilt tree before any build happened here.Before / after, per file
ECONNREFUSEDlinesTests 586 passedTests 4 passedTests 4 passedTests 3 passedTests 1 passedFinal run at
0e92beeover the five files plus the pin: exit 0,Test Files 6 passed (6),Tests 601 passed (601), zero lines matchingnetwork-escapeorECONNREFUSED.Suites and gates — at
0e92bee, exit codes captured by redirect-then-capturepnpm exec vitest run packages/plugin-calendar/ packages/plugin-grid/ packages/plugin-view/ packages/plugin-charts/ examples/schema-catalog/ scripts/__tests__/network-escape-ledger.test.ts packages/plugin-detail/src/renderers/__tests__/record-details.hideEmptyRetired-7129.test.tsx→ exit 0,Test Files 247 passed (247),Tests 3960 passed (3960), 0network-escapelines anywhere in the run.node scripts/check-changeset-presence.mjs→ exit 0:4 source file(s) of 4 released package(s) changed, and this change declares 1 changeset(s)/Every one of them has an EMPTY frontmatter — declared as releasing nothing, which is the explicit exemption and a complete answer to this gate.(Test files under a released package'ssrc/do owe one; answered the repo's way, not with a label.)pnpm check:control-bytes→ exit 0,scanned 6435 tracked text file(s); skipped 85 binary. Plus a self-scan beyond the gate:grep -naPfor the control range over all 8 changed paths — no hits.node scripts/check-governed-queue-guard.mjs --testover all 8 changed paths → exit 0,NOT GOVERNED — 8 path(s) checked against 5 governed surface(s); none matched.pnpm type-check:scripts→ exit 0.type-checkandlint(plugin-calendar, plugin-charts, plugin-grid, plugin-view, examples/schema-catalog): all exit 0, 0 errors. Proven non-vacuous rather than assumed:tsc -p tsconfig.test.json --listFilesnames each edited test file (1 hit each), andeslint --format jsonreports each edited file among the linted set. Warning counts are unchanged — everyno-explicit-anywarning in the touched files sits on a pre-existing line, outside this diff's hunks; the added code usesunknown.pnpm check:vi-mock-specifiers0,pnpm check:vi-mock-inherit0,pnpm changeset:check0,pnpm check:unreferenced-sources0,pnpm lint:coverage0 (46/46 packages linted, 0 with outstanding errors).turbo run build --filter=./packages/* --concurrency=2→ exit 0,Tasks: 39 successful, 39 total. Needed only because each package'stype-checkdepends on^build; the suites themselves need nodist/.Readers of the two symbols (
git grep -loverscripts/ packages/ .github/ vitest.*, unpiped):KNOWN_ESCAPES→vitest.setup.network-escape-guard.ts,scripts/__tests__/network-escape-ledger.test.ts, andpackages/plugin-detail/src/renderers/__tests__/record-details.hideEmptyRetired-7129.test.tsx(a prose reference in a comment — it names the list to say it deliberately does NOT join it; no code reads it).PINNED_LEDGER→ the first two only. Nothing in.github/names either. All three files were run above.Docstring prose
Two sentences in the guard and one in the pin said "the 21 files"; the sets now hold 16. Reworded to "what REMAINS of the 21 files measured on
67dadd6" so the provenance survives without a count that every batch would have to re-edit. No judgement byte moves in either file.Not in this batch, and why
state: open,merged: false,mergeable_state: unstable. They stay for batch 2.Out of scope, filed
#7996 (
finding) — the one other landedsecurity/explaindouble, inrecord-details.hideEmptyRetired-7129.test.tsx, answers{ allowed: true }, a key neither explain hook reads. It passes only because both hooks then take the same fail-open path they take onECONNREFUSED, so it pins a wire contract that does not exist. Not touched here: that file is not on the ledger and is outside this batch's file surface.CI note
Live E2E (informational)is red on every branch today for an upstream reason (#7990 / objectstack#16186) and is not this diff's.🤖 Generated with Claude Code
https://claude.ai/code/session_01MM7kaS4dPpYHV5BsMyu4tQ
Generated by Claude Code